package com.example.xbrother.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ContentFontStyle;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.BooleanEnum;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
import com.example.xbrother.convertor.CustomMoneyConverter;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
@HeadStyle(fillForegroundColor = 42, fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, borderBottom = BorderStyleEnum.THIN, borderTop = BorderStyleEnum.THIN, borderLeft = BorderStyleEnum.THIN, borderRight = BorderStyleEnum.THIN)
@HeadFontStyle(color = 32767, fontHeightInPoints = 11, fontName = "微软雅黑", bold = BooleanEnum.TRUE)
@ContentStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, borderBottom = BorderStyleEnum.THIN, borderTop = BorderStyleEnum.THIN, borderLeft = BorderStyleEnum.THIN, borderRight = BorderStyleEnum.THIN)
@ContentFontStyle(color = 32767, fontHeightInPoints = 10, fontName = "微软雅黑")
public class ExcelMaterialVo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @ExcelIgnore
    private Integer id;

    /**
     * 编码
     */
    @ExcelProperty(value = "物料编码", index = 2)
    private String code;

    /**
     * 设备名称
     */
    @ExcelProperty(value = "设备名称", index = 3)
    private String name;

    /**
     * 型号
     */
    @ExcelProperty(value = "型号", index = 4)
    private String modelType;

    /**
     * 规格参数
     */
    @ExcelProperty(value = "规格参数", index = 5)
    private String specs;

    /**
     * 单价
     */
    @ExcelProperty(value = "目录单价", index = 8, converter = CustomMoneyConverter.class)
    private BigDecimal price;

    /**
     * 单位(件、只、个)
     */
    @ExcelProperty(value = "单位", index = 7)
    private String unit;

    /**
     * 分类
     */
    @ExcelProperty(value = "分类", index = 0)
    private String type;

    //************************************************************************

    /**
     * 物料-数量
     */
    @ExcelProperty(value = "数量", index = 6)
    private Integer num = 1;
    /**
     * 折扣系数
     */
    @ExcelProperty(value = "折扣系数", index = 10)
    private BigDecimal discount = BigDecimal.ONE;
    /**
     * 品牌
     */
    @ExcelProperty(value = "品牌", index = 13)
    private String brand;
    /**
     * 备注
     */
    @ExcelProperty(value = "备注", index = 14)
    private String remark;
    /**
     * 序号
     */
    @ExcelProperty(value = "编号", index = 1)
    private Integer index;
    /**
     * 目录总价
     */
    @ExcelProperty(value = "目录总价", index = 9, converter = CustomMoneyConverter.class)
    private BigDecimal srcTotalCost = BigDecimal.ZERO;
    /**
     * 总价
     */
    @ExcelProperty(value = "总价", index = 12, converter = CustomMoneyConverter.class)
    private BigDecimal discountTotalCost = BigDecimal.ZERO;
    /**
     * 折扣后的单价
     */
    @ExcelProperty(value = "单价", index = 11, converter = CustomMoneyConverter.class)
    private BigDecimal discountPrice = BigDecimal.ZERO;
}
